
var h = $(window).height();
    $('.newStyle').css({minHeight: h - 20 + 'px'});
    $(window).resize(function(){
        h = $(window).height();
        $('.newStyle').css({minHeight: h - 20 + 'px'});
    })
$(window).ready(function() {
    var textarea = document.getElementById('textarea');
    var pre = document.getElementById('pre');
    textarea.oninput = function() {
        pre.textContent = textarea.value;
        textarea.style.height = pre.offsetHeight + 'px';
    }
    $(".wordText").click(function(event) {
        $('#wordP').html($('#textarea').val());
        $("#pagecontent").wordExport('研判报告');
    });
    var location = window.location.search;
        location = location.split('=')[1];
        $.ajax({
            type: 'get',
            url: baseUrls + 'analysis/report/' + location,
            beforeSend: function(){
                Loading();
            },
            success: function(response){
                closeLoading();
                $('.displacement').html('');
                if(response.content.clueList.length > 0){
                    $('.reportName').html(nulls(response.content.clueList[0].ajmc));
                    $('.ajbhOne').html(nulls(response.content.clueList[0].ajbh));
                    $('.ajmcOne').html(nulls(response.content.clueList[0].ajmc));
                    $('.afsjOne').html(nulls(response.content.clueList[0].afkssj)+' ~ '+nulls(response.content.clueList[0].afjssj));
                    if(response.content.clueList[0].afkssj == null && response.content.clueList[0].afjssj == null){
                        $('.afsjOne').html('无');
                    }
                    $('.bjsjOne').html(nulls(response.content.clueList[0].ylzd8));
                    $('.ajmsOne').html(nulls(response.content.clueList[0].jyaq));
                    for(var i = 0; i < response.content.clueList.length; i++){
                        var zax = '',
                            xyx = '',
                            clx = '',
                            wpx = '';
                        if(response.content.clueList[i].zagj != null){
                            zax += '<div class="calibrationTime"><label>作案工具：</label><span class="specific">'+ response.content.clueList[i].zagj +'</span></div>';
                        }
                        if(response.content.clueList[i].gjsm != null){
                            zax += '<div class="calibrationTime"><label>工具说明：</label><span class="specific">'+ response.content.clueList[i].gjsm +'</span></div>';
                        }
                        if(response.content.clueList[i].sjsbh != null){
                            xyx += '<div class="calibrationTime"><label>手机设备号：</label><span class="specific">'+ response.content.clueList[i].sjsbh +'</span></div>';
                        }
                        if(response.content.clueList[i].wh != null){
                            xyx += '<div class="calibrationTime"><label>外号：</label><span class="specific">'+ response.content.clueList[i].wh +'</span></div>';
                        }
                        if(response.content.clueList[i].bm != null){
                            xyx += '<div class="calibrationTime"><label>别名：</label><span class="specific">'+ response.content.clueList[i].bm +'</span></div>';
                        }
                        if(response.content.clueList[i].fx != null){
                            xyx += '<div class="calibrationTime"><label>发型：</label><span class="specific">'+ response.content.clueList[i].fx +'</span></div>';
                        }
                        if(response.content.clueList[i].yzys != null){
                            xyx += '<div class="calibrationTime"><label>衣服颜色：</label><span class="specific">'+ response.content.clueList[i].yzys +'</span></div>';
                        }
                        if(response.content.clueList[i].lx != null){
                            xyx += '<div class="calibrationTime"><label>脸型：</label><span class="specific">'+ response.content.clueList[i].lx +'</span></div>';
                        }
                        if(response.content.clueList[i].tx != null){
                            xyx += '<div class="calibrationTime"><label>体型：</label><span class="specific">'+ response.content.clueList[i].tx +'</span></div>';
                        }
                        if(response.content.clueList[i].cph != null){
                            clx += '<div class="calibrationTime"><label>车牌号：</label><span class="specific">'+ response.content.clueList[i].cph +'</span></div>';
                        }
                        if(response.content.clueList[i].cpys != null){
                            clx += '<div class="calibrationTime"><label>车牌颜色：</label><span class="specific">'+ response.content.clueList[i].cpys +'</span></div>';
                        }
                        if(response.content.clueList[i].cllx != null){
                            clx += '<div class="calibrationTime"><label>车辆类型：</label><span class="specific">'+ response.content.clueList[i].cllx +'</span></div>';
                        }
                        if(response.content.clueList[i].clxh != null){
                            clx += '<div class="calibrationTime"><label>车辆型号：</label><span class="specific">'+ response.content.clueList[i].clxh +'</span></div>';
                        }
                        if(response.content.clueList[i].cltz != null){
                            clx += '<div class="calibrationTime"><label>车辆特征：</label><span class="specific">'+ response.content.clueList[i].cltz +'</span></div>';
                        }
                        if(response.content.clueList[i].sftp != null){
                            clx += '<div class="calibrationTime"><label>是否套牌：</label><span class="specific">'+ response.content.clueList[i].sftp +'</span></div>';
                        }
                        if(response.content.clueList[i].mc != null){
                            wpx += '<div class="calibrationTime"><label>名称：</label><span class="specific">'+ response.content.clueList[i].mc +'</span></div>';
                        }
                        if(response.content.clueList[i].tz != null){
                            wpx += '<div class="calibrationTime"><label>特征：</label><span class="specific">'+ response.content.clueList[i].tz +'</span></div>';
                        }
                        $('.displacement').append('<div class="disContent"><div class="clueTitle"><h5 class="clue">'+ nulls(response.content.clueList[i].qzmc) +'</h5><div class="area"><label>案件区域：</label><span class="specific">'+ nulls(response.content.clueList[i].ajqy) +'</span></div><div class="area"><label>线索名称：</label><span class="specific">'+ nulls(response.content.clueList[i].qzmc) +'</span></div></div><div class="disInfo commonStyle clueDisInfo"><p>作案工具</p>'+ zax +'<p>嫌疑人</p>'+ xyx +'<p>涉案车辆</p>'+ clx +'<p>损失物品</p>'+ wpx +'</div>');
                    }
                    var fjx = '';
                    for(var i = 0; i < response.content.tpList.length; i++){
                        fjx += '<div class="area"><div class="img"><img src="'+ response.content.tpList[i].wllj +'" onerror="nofind(this)"></div><div class="fileSolution"><label>文件说明：</label><span>'+ nulls(response.content.tpList[i].tpylzd7) +'</span></div><div class="supplementSolution"><label>补充说明：</label><span class="specific">'+ nulls(response.content.tpList[i].tptzms) +'</span></div></div>';
                    }
                    $('.displacement').append('<p>附件</p>'+ fjx);
                }else{
                    Msg('暂无数据');
                }
            },
            error: function(){
                closeLoading();
                Msg('案件信息获取失败');
            }
        })
});
function nofind(item){
    item.src = 'common/img/nothing.png';
    item.onerror = null;
}
function nulls(item){
    var callback;
    if(item != null && item != undefined){
        callback = item;
    } else {
        callback = '无';
    }
    return callback;
}